﻿<%@ Page Title="" Language="C#" MasterPageFile="~/BookingSite/MasterPage.master" AutoEventWireup="true" CodeFile="Booking.aspx.cs" Inherits="BookingSite_Booking" %>
<%@ Import Namespace="Acms.Bll" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
 <acms:JavascriptFile ID="uiCoreMin" Path="~/script/ui.core.min.js" runat="server" />
    <acms:JavascriptFile ID="uiAccordianMin" Path="~/script/ui.accordion.min.js" runat="server" />
    <script type="text/javascript">
        $(document).ready(function() {
        var accordionStateId = '<%= accordianState.ClientID %>';
        var accordionId = '<%= accordian.ClientID %>';
            //- 0 to ensure varient is int not string
        if (accordionStateId != "" && accordionId != "") {
            var tmpActive = $("#" + accordionStateId).val() - 0;
            $("#" + accordionId).accordion({ active: tmpActive, change: function(e, ui) { $("#" + accordionStateId).val($(ui.newHeader).prevAll().length / 2); } });
            }
        });
    </script>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

    <asp:HiddenField ID="accordianState" Value="0" runat="server" />
    
    <div class="containerB"/></div>

        <asp:Panel ID="pnlSlots" runat="server" CssClass="pnlDetails" Visible="true">
            <div class="bookingContainer">
                <asp:Panel ID="accordian" CssClass="accordianContainer" runat="server">
                    <acms:SimpleRepeater ID="rpt" DataSourceID="dsDates" runat="server">
                        <ItemTemplate>
                            <h3 class='<%#Container.DisplayIndex % 2 == 0 ? "h3Left" : "h3Right"%>'><%#Eval("Date", "{0:ddd dd MMM yyyy}") %></h3>
                                <div class='wrapper <%#Container.DisplayIndex % 2 == 0 ? "wrapperLeft" : "wrapperRight"%>'>
                                    <div class="innerWrapper">
                                        <asp:ListView ID="listTimes" OnDataBinding="listTimes_DataBinding" OnItemDataBound="listTimes_ItemDataBound" OnItemCommand="listTimes_ItemCommand" GroupItemCount="4" runat="server" c>
                                            <LayoutTemplate>
                                                    <asp:PlaceHolder ID="groupPlaceholder" runat="server" />
                                            </LayoutTemplate>
                                            
                                            <GroupTemplate>
                                                <div class="outer" style="width:24.9%;float:left;">
                                                    <asp:PlaceHolder ID="itemPlaceholder" runat="server" />
                                                </div>
                                            </GroupTemplate>
                                            
                                            <ItemTemplate>
                                                <asp:Panel CssClass="item" ID="pnlItem" runat="server">
                                                    <asp:LinkButton ID="btnItem" Text='<%#Eval("DateTime", "{0:HH.mm}") %>' CommandName="SelectDate"
                                                        CommandArgument='<%# Eval("Id") %>' runat="server" />
                                                </asp:Panel>
                                            </ItemTemplate>
                                        </asp:ListView>
                                        <div style="clear:both"></div>
                                    </div>            
                                    
                                </div>
                            </ItemTemplate> 
                        </acms:SimpleRepeater>
                </asp:Panel>
                <acms:EventDrivenDataSource ID="dsDates" OnSelect="dsDates_Select" runat="server" />
            </div>
            <div class="clearfix" style="padding: 20px 40px 50px;">
                <asp:HyperLink ID="LinkButton2" NavigateUrl="~/BookingSite/Default.aspx" CssClass="btnHome" runat="server" ImageUrl="~/BlookingSite/img/btn_home.gif" Text="Home"/>
            </div>
        </asp:Panel>

        <asp:Panel ID="pnlDetails" runat="server" CssClass="pnlDetails" Visible="false">
            <div class="formHolder">
    
                <asp:Panel ID="pnlErrorMessage" runat="server" class="errorMessage" EnableViewState="false" Visible="false">
        <span>This email address belongs to another user.</span>
    </asp:Panel>
                <ul class="formUl">
        <li class="formLi">
            <asp:Label AssociatedControlID="txtFirstName" CssClass="formLabel" runat="server" ID="lblFirstName" Text="Name" />
            <asp:TextBox TextMode="SingleLine" ID="txtFirstName" runat="server"/>
            <asp:RequiredFieldValidator ValidationGroup="vgSubmit" ID="RequiredFieldValidator1" CssClass="formError" runat="server" ControlToValidate="txtFirstName" Display="Dynamic" ErrorMessage="Please Check" />
        </li>
        <li class="formLi">
            <asp:Label AssociatedControlID="txtSurname"  CssClass="formLabel" runat="server" ID="lblSurname" Text="Surname" />
            <asp:TextBox TextMode="SingleLine" ID="txtSurname" runat="server"/>
                <asp:RequiredFieldValidator ValidationGroup="vgSubmit" ID="RequiredFieldValidator2" CssClass="formError" runat="server" ControlToValidate="txtSurname" Display="Dynamic" ErrorMessage="Please Check" />
        </li>
        <li class="formLi">
            <asp:Label AssociatedControlID="txtAge" CssClass="formLabel" runat="server" ID="lblAge" Text="Age" />
            <asp:TextBox TextMode="SingleLine" ID="txtAge" runat="server"/>
            <asp:RequiredFieldValidator ValidationGroup="vgSubmit" ID="RequiredFieldValidator10" CssClass="formError" runat="server" ControlToValidate="txtAge" Display="Dynamic" ErrorMessage="Please Check" />
            <asp:RangeValidator ValidationGroup="vgSubmit" ID="RequiredFieldValidator4" CssClass="formError" runat="server" ControlToValidate="txtAge" Display="Dynamic" ErrorMessage="Invalid Age" MinimumValue="1" MaximumValue="100" Type="Integer" />
        </li>
        <li class="formLi">
            <asp:Label AssociatedControlID="rdoSex" CssClass="formLabel" runat="server" ID="lblSex" Text="Sex" />
            <asp:RadioButtonList ID="rdoSex" RepeatLayout="Flow" RepeatDirection="Horizontal" runat="server">
                <asp:ListItem Text="Male" Value="0" />
                <asp:ListItem Text="Female" Value="1" />
            </asp:RadioButtonList>
            <asp:RequiredFieldValidator ValidationGroup="vgSubmit" ID="RequiredFieldValidator5" CssClass="formError" runat="server" ControlToValidate="rdoSex" Display="Dynamic" ErrorMessage="Please Check" />
        </li>
        <li class="formLi">
            <asp:Label AssociatedControlID="txtEmail" CssClass="formLabel" runat="server" ID="lblEmail" Text="Email" />
            <asp:TextBox TextMode="SingleLine" ID="txtEmail" runat="server"/>
                <asp:RegularExpressionValidator ValidationGroup="vgSubmit" ID="valEmailFormat" ControlToValidate="txtEmail"  CssClass="formError" ErrorMessage="Invalid Email" Display="Dynamic" runat="server" ValidationExpression="^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$" />
                <asp:RequiredFieldValidator ValidationGroup="vgSubmit" ID="RequiredFieldValidator3" runat="server" CssClass="formError" ControlToValidate="txtEmail" Display="Dynamic" ErrorMessage="Please Check" />
        </li>
        <li class="formLi">
            <asp:Label AssociatedControlID="txtPhone" CssClass="formLabel" runat="server" ID="lblPhone" Text="Phone" />
            <asp:TextBox TextMode="SingleLine" ID="txtPhone" runat="server"/>
            <asp:RequiredFieldValidator ValidationGroup="vgSubmit" ID="RequiredFieldValidator9" CssClass="formError" runat="server" ControlToValidate="txtPhone" Display="Dynamic" ErrorMessage="Please Check" />
        </li>
        <li class="formLi">
            <asp:Label AssociatedControlID="txtAddress1" CssClass="formLabel" runat="server" ID="lblAddress1" Text="Address 1" />
            <asp:TextBox TextMode="SingleLine" ID="txtAddress1" runat="server"/>
            <asp:RequiredFieldValidator ValidationGroup="vgSubmit" ID="RequiredFieldValidator6" CssClass="formError" runat="server" ControlToValidate="txtAddress1" Display="Dynamic" ErrorMessage="Please Check" />
        </li>
        <li class="formLi">
            <asp:Label AssociatedControlID="txtAddress2" CssClass="formLabel" runat="server" ID="lblAddress2" Text="Address 2" />
            <asp:TextBox TextMode="SingleLine" ID="txtAddress2" runat="server"/>
        </li>
        <li class="formLi">
            <asp:Label AssociatedControlID="txtTown" CssClass="formLabel" runat="server" ID="lblTown" Text="Town" />
            <asp:TextBox TextMode="SingleLine" ID="txtTown" runat="server"/>
            <asp:RequiredFieldValidator ValidationGroup="vgSubmit" ID="RequiredFieldValidator7" CssClass="formError" runat="server" ControlToValidate="txtTown" Display="Dynamic" ErrorMessage="Please Check"/>
        </li>
        <li class="formLi">
            <asp:Label AssociatedControlID="txtPostCode" CssClass="formLabel" runat="server" ID="lblPostCode" Text="Post Code" />
            <asp:TextBox TextMode="SingleLine" ID="txtPostCode" runat="server"/>
            <asp:RequiredFieldValidator ValidationGroup="vgSubmit" ID="RequiredFieldValidator8" CssClass="formError" runat="server" ControlToValidate="txtPostCode" Display="Dynamic" ErrorMessage="Please Check"/>
        </li>
        <li class="formLi">
            <asp:CheckBox ID="chkAgree" runat="server" />
            <asp:Label AssociatedControlID="chkAgree" runat="server" Text="Please tick this box if you DO NOT wish to be contacted by us about any future special events or promotions at the Harlequin."/>
        </li>
    </ul>
            </div>
    
            <div class="ShowSelectedTime clearfix">
                <span>Session time : </span><asp:Label ID="lblSelectedTime" runat="server" Text="Sat 25/04/2009 @ 16:30" />
                <asp:LinkButton CssClass="btnChangeTime" ID="btnChangeTime" Text="Change Time" CausesValidation="false" runat="server"/>
            </div>
    
            <div class="clearfix" style="padding: 20px 40px 50px;">
                <asp:LinkButton CssClass="btnSubmit" ValidationGroup="vgSubmit" runat="server"  ID="btnSubmit" Text="Book" />
                <asp:HyperLink NavigateUrl="~/BookingSite/Default.aspx" CssClass="btnHome" runat="server" ImageUrl="~/BookingSite/img/btn_home.gif" Text="Home"/>
            </div>
        </asp:Panel>

        <asp:Panel ID="pnlConfirmation" runat="server" Visible="false" CssClass="pnlConfirmation cleafix">
            <%--<SCRIPT language="JavaScript">
                var axel = Math.random() + "";
                var a = axel * 10000000000000;
                document.write('<IFRAME SRC="http://fls.uk.doubleclick.net/activityi;src=1813552;type=brand683;cat=brand262;ord=' + a + '?" WIDTH=1 HEIGHT=1 FRAMEBORDER=0></IFRAME>');
            </SCRIPT>
            <NOSCRIPT>
                <IFRAME SRC="http://fls.uk.doubleclick.net/activityi;src=1813552;type=brand683;cat=brand262;ord=1?" WIDTH=1 HEIGHT=1 FRAMEBORDER=0></IFRAME>
            </NOSCRIPT>--%>
            <p><strong>Congratulations!</strong></p>
            <p>Your booking has been succesful.</p>
            <p>Please check your email for a confirmation.</p>
            <p>Contact the Harlequin Customer Services on 01923 227438 if you would like to change you booking.</p>              
            <asp:HyperLink ID="HyperLink1" NavigateUrl="~/BookingSite/Default.aspx" CssClass="btnHome" runat="server" ImageUrl="~/BookingSite/img/btn_home.gif" />
        </asp:Panel>
    
    
    <div class="footer"></div>
</asp:Content>

